home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: alt.msdos.programmer,comp.lang.c,comp.lang.pascal.misc
- Path: angel.qdeck.com!usenet
- From: @test111
- Subject: Re: typecasting preferences
- Organization: Quarterdeck Corp.
- Date: Tue, 16 Apr 1996 15:59:30 GMT
- Message-ID: <N.041696.085930.117@machin.qdeck.com>
- X-Newsreader: Quarterdeck Message Center [2.00]
- References: <4l020g$i9j@srvr1.engin.umich.edu>
- Sender: usenet@qdeck.com (Netnews Administrator)
-
- On 4/16/96 4:58AM, in message <4l020g$i9j@srvr1.engin.umich.edu>, HASDI
- RODZMANN HASHIM <hasdi@news-server.engin.umich.edu> wrote:
-
- > Hi guys! I think my earlier post got lost so here it is again.... This is
- > for a student compiler project of mine....
- >
- > If you have a choice, do you want the parethesis pair over the caster
- > (C-style) or over the castee (Pascal-style)? eg...
- >
- > int a;
- > float b;
- >
- > a = (int)b; /* cast to int */
- > a = int(b); /* allowable in C++ */
- >
- > ...as for Pascal...
- > a := integer(b); { "a" in an integer and "b" is a real }
- >
- > Thanx!
- >
- I believe you would want the parens over the type not the variable. Your first
- example a = (int)b looks like the way I would do it anyway. I am sure someone
- will correct me on this one.
-
- -John Machin
- machin@gnn.com
-
-